#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>

struct resource res[] = {
	[0] = {
		.start = 0x139d000,
		.end = 0x139d000 + 0x3,
		.flags = IORESOURCE_MEM,
	},

	[1] = {
		.start = 199,
		.end = 199,
		.flags = IORESOURCE_IRQ,
	},
};

void hello_release(struct device *dev)
{
	printk("hello_release \n");
	return;
}

struct platform_device hello_device = {
	.name = "hello",
	.id = -1,
	.dev.release = hello_release,
	.num_resources = ARRAY_SIZE(res),
	.resource = res,
};

static int hello_init(void)
{
	int ret = 0;
	printk(KERN_ALERT "hello_init \n");
	platform_device_register(&hello_device);
	return ret;
}

static void hello_exit(void)
{
	printk(KERN_ALERT "hello_exit \n");
	platform_device_unregister(&hello_device);
	return;
}

MODULE_LICENSE("Dual BSD/GPL");

module_init(hello_init);
module_exit(hello_exit);
